#include <stdio.h>
#include <iostream>
#include "keyTool.h"
#include "ndnKeyTool.h"

int verifySign(char *jsonstr) {
	NDNKeyTool ndnKeyTool ;
	int ret = ndnKeyTool.verifySign(jsonstr) ;
	return ret ;
}
int verifySignWithCert(char *jsonstr, char *cert) {
	NDNKeyTool ndnKeyTool ;
	int ret = ndnKeyTool.verifySign(jsonstr,cert) ;
	return ret ;
}

char* signCert(char *signRequest){
	NDNKeyTool ndnKeyTool ;
	std::string certStr = ndnKeyTool.signCert(signRequest) ;
	char* cert = (char*)malloc(certStr.size()+1) ;
	memcpy(cert, certStr.data(), certStr.size()) ;
	cert[certStr.size()] = 0 ;
	return cert ;
}
